package com.example.jw_web.Control;


import com.example.jw_web.Servlet.AddOursServlet;
import com.example.jw_web.pojo.Result;
import com.example.jw_web.pojo.Wait_member;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@CrossOrigin(origins = "*")  //允许后端访问

public class AddOurs {


    @Autowired
    AddOursServlet addOursServlet;

     @PostMapping("/join")
    public Result add_member(@RequestBody Wait_member wait_member)
     {
         log.info("爱好："+ wait_member.getHobby());
          addOursServlet.saveMembers(wait_member);
          return Result.success();
     }

}
